<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Ant Tasks</title>
</head>

<body>

<h2>Ant Tasks</h2>

<p>JBehave supports accessing the Embedder functionality via Ant
tasks:</p>

<ul>
    <li><a
        href="javadoc/ant/org/jbehave/ant/MapStoriesAsEmbeddables.html">MapStoriesAsEmbeddables</a></li>
	<li><a
		href="javadoc/ant/org/jbehave/ant/RunStoriesAsEmbeddables.html">RunStoriesAsEmbeddables</a></li>
    <li><a href="javadoc/ant/org/jbehave/ant/MapStoriesAsPaths.html">MapStoriesAsPaths</a></li>
	<li><a href="javadoc/ant/org/jbehave/ant/RunStoriesAsPaths.html">RunStoriesAsPaths</a></li>
	<li><a
		href="javadoc/ant/org/jbehave/ant/RunStoriesWithAnnotatedEmbedderRunner.html">RunStoriesWithAnnotatedEmbedderRunner</a></li>
	<li><a href="javadoc/ant/org/jbehave/ant/ReportStepdocs.html">ReportStepdocs</a></li>
    <li><a href="javadoc/ant/org/jbehave/ant/ReportStepdocsAsEmbeddables.html">ReportStepdocsAsEmbeddables</a></li>
	<li><a href="javadoc/ant/org/jbehave/ant/GenerateStoriesView.html">GenerateStoriesView</a></li>
</ul>

<p>Ant tasks support the following properties:</p>

<ul>
	<li>sourceDirectory: defaults to <b>src/main/java</b></li>
	<li>testSourceDirectory: defaults to <b>src/test/java</b></li>
    <li>outputDirectory: defaults to <b>target/classes</b></li>
    <li>testOutputDirectory: defaults to <b>target/test-classes</b></li>
	<li>scope: [compile|test], defaults to <b>compile</b></li>
	<li>includes: CSV of include patterns</li>
	<li>excludes: CSV of exclude patterns</li>
	<li>metaFilters: CSV of meta filters</li>
    <li>systemProperties: CSV of system properties to set during execution</li>	
	<li>batch: [true|false], defaults to <b>false</b></li>
	<li>skip: [true|false], defaults to <b>false</b></li>
	<li>ignoreFailureInStories: [true|false], defaults to <b>false</b></li>
	<li>ignoreFailureInView: [true|false], defaults to <b>false</b></li>
	<li>generateViewAfterStories: [true|false], defaults to <b>true</b></li>
    <li>storyTimeoutInSecs: defaults to <b>300</b></li>
    <li>storyTimeoutInSecsByPath: defaults to <b>300 (the default of storyTimeoutInSecs)</b></li>
    	<ul>
    		<li>Overrides the default value in storyTimeoutInSecs, and can be expressed as a CSV of regex
    		<br>expressions matching story paths. E.g. "*/long/.story:5000,*/short/.story:200,*/medium/m_story.story:1000"</br></li>
    	</ul>
	<li>failOnStoryTimeout: [true|false], defaults to <b>false</b></li>
    <li>threads: defaults to <b>1</b></li>
	<li>embedderClass: defaults to <a
		href="javadoc/core/org/jbehave/core/embedder/Embedder.html">Embedder</a>.</li>
	<li>injectableEmbedderClass: defaults to <code>null</code></li>
	<li>storyFinderClass: defaults to <a
		href="javadoc/core/org/jbehave/core/io/StoryFinder.html">StoryFinder</a></li>
</ul>

<span class="followup">Performance Testing: You can make use of
<b>storyTimeoutInSecs</b> and <b>storyTimeoutInSecsByPath</b> to ensure
tests run under the time(s) specified
</span>

<p>An example of a typical Ant task usage is:</p>
<script type="syntaxhighlighter" class="brush: xml">
<![CDATA[
    <taskdef name="runStoriesAsEmbeddables"
             classname="org.jbehave.ant.RunStoriesAsEmbeddables"
             classpathref="your.runtime.classpath"/>

    <runStoriesAsEmbeddables
            includes="**/*Stories.java"
            metaFilters="+author *,-skip"
            systemProperties="java.awt.headless=true"
            ignoreFailureInStories="true"
            ignoreFailureInView="false"
            generateViewAfterStories="true"/>

]]>
</script>

<p>Remember to include <b>jbehave-ant</b> to your runtime classpath.</p>

<p>The default scope is <b>compile</b>, which means that the stories
will be looked up in the source directory (which defaults to <b>src/main/java</b>
by can be overridden). If the scope is set to <b>test</b> the stories
will be looked up in the test source directory (which defaults to <b>src/test/java</b>
but can be overridden).</p>

<div class="clear">
<hr />
</div>

</body>
</html>
